import RcTable, { IColumnProps } from 'rc-table';
import React from 'react';

export interface ITableProps {
  data: object[];
  columns: IColumnProps[];
  hideColumnLine?: boolean;
}

export default class Table extends React.Component<ITableProps> {
  public render() {
    let prefixCls;
    if (this.props.hideColumnLine === undefined || this.props.hideColumnLine === true) {
      prefixCls = 'rc-table';
    } else {
      prefixCls = 'vertical-table';
    }
    return (
      <RcTable
        prefixCls={prefixCls}
        {...this.props}
      />
    );
  }
}
